<!DOCTYPE>
<html>
<head>
    <title>标签管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--<meta name="_csrf_token" content="${_csrf.token}"/>-->
    <!--<meta name="_csrf_header" content="${_csrf.headerName}"/>-->
    <link href="../resources/css/backstage/list.css" type="text/css" rel="stylesheet"/>
    <link href="../resources/css/backstage/table.css" type="text/css" rel="stylesheet"/>
</head>

<body>
<div class="d-box">
    <div class="d-button">
        <input class="functionButton" type="button" onClick="javascript:window.location.href='/probe/backstage/addTag'" value="添加标签">
    </div>

    <table class="t-list-table" cellSpacing="1" cellPadding="0" width="100%" border="0">
        <thead class="t-list-thead">
        <tr>
            <th>标签名称</th>
            <th>排序</th>
            <th>操作</th>
        </tr></thead>
        <tbody class="t-list-tbody" align="center">

        <!--<c:forEach items="${tagList}" var="entry">-->
            <!--<tr >-->
                <!--<td width="60%">${entry.name}</td>-->
                <!--<td width="20%">${entry.sort}</td>-->
                <!--<td width="20%">-->
                    <!--<a href="${config:url(pageContext.request)}control/tag/manage${config:suffix()}?method=edit&tagId=${entry.id }">修改</a>-->
                    <!--<a href="#" onclick="javascript:if(window.confirm('确定删除吗? ')){deleteTag('${entry.id }');return false;}else{return false};" hidefocus="true" ondragstart= "return false">删除</a>-->
                <!--</td>-->
            <!--</tr>-->
        <!--</c:forEach>-->
        </tbody>
    </table>
</div>
<script src="../resources/js/common/jquery.min.js" type="text/javascript"></script>
<script src="../resources/js/backstage/Tool.js" type="text/javascript"></script>
<script src="../resources/js/backstage/ajax.js" type="text/javascript"></script>
<script src="../resources/js/backstage/topic/taglist.js" type="text/javascript"></script>
<!-- IE6 会弹出'已终止操作'错误，本JS要放在Body标签下面 -->
<script type="text/javascript" src="../resources/js/backstage/spin.min.js" ></script>
<script type="text/javascript">

    //删除标签
    function deleteTag(id){
        var parameter = "";

        parameter += "&tagId="+id;

        var csrf =  getCsrf();
        parameter += "&_csrf_token="+csrf.token;
        parameter += "&_csrf_header="+csrf.header;

        //删除第一个&号,防止因为多了&号而出现警告: Parameters: Invalid chunk ignored.信息
        if(parameter.indexOf("&") == 0){
            parameter = parameter.substring(1,parameter.length);
        }
        post_request(function(value){
            if(value == "1"){
                window.location.reload();
            }else{
                alert("删除失败");
            }
        },
            "${config:url(pageContext.request)}control/tag/manage${config:suffix()}?method=delete&timestamp=" + new Date().getTime(), true,parameter);
    }

</script>
</body>
</html>
